package recursion.simpleExamples;

/**
 * 二个简单的方法
 *      1）逆序打印
 *      2）阶乘问题
 */
public class printMyself {
    public static void main(String[] args) {
       // printNum(5);
        System.out.println(Fibonacci(4));
    }
    public static void printNum(int n){
        if (n!=1){
            printNum(n-1);
        }
        System.out.print(n+",");
    }
    public static int Fibonacci(int n){
        if(n!=1){
            return  Fibonacci(n-1) * n;
        }
        return 1;
    }
}
